<style>
<!--
.helper-float-body{
	overflow: auto;
}
.auction-winner{
	color:#a3b0b5;
}
.auction-last-time{
	color:#a3b0b5;
}
.auction-winner-price{
	color:#4a5257;
}

-->
</style>

<div class="region region-auction-shelf shelf-cateogry">
	<div class="auction-shelf-header">
		<h2 class="auction-shelf-title"><?php echo $categoryTitle?></h2>
		<div class="auction-shelf-search">
			<div class='auction-search-options'>
				<span>Show:</span>
				<select class='auction-search-status'>
					<option><?php echo ucfirst($categoryTitle)?></option>
				</select>
				<span>Items per page:</span>
				<select class='auction-search-pages'>
					<option>20</option>
					<option>15</option>
					<option>10</option>
					<option>5</option>
				</select>
			</div>
		</div>
	</div>
	<div class="auction-shelf-content">
		<?php
		$this->widget('application.components.widgets.CAuctionsPool',array(
			'id'            => 'category-auction',
			'dataProvider'  => $model,
			'itemView'      => 'application.components.widgets.auctionPool.item._CAuctionItemCategory'
		))
		?>
	</div>
	<div class="auction-shelf-footer helper-float-body">
		<div class="auction-shelf-search">
			<div class='auction-search-options'>
				<span>Items per page:</span>
				<select class='auction-search-pages'>
					<option>20</option>
					<option>15</option>
					<option>10</option>
					<option>5</option>
				</select>
			</div>
		</div>
	</div>
</div>

<script>
	$(document).ready(function(){
		$('.auction-search-pages').val(<?php echo $limit?>);
		client.setHash('poolPage',1);
		$('body').on('change','.auction-search-pages',function(){
			var selectValue=$(this).children('option:selected').val();
			$.ajax({
				data:{pages:selectValue},
				type:'post',
				success:function(data){
					$('.region.region-auction-shelf.shelf-cateogry').html('');
					$('.region.region-auction-shelf.shelf-cateogry').html(data);
					$('.auction-search-pages').val(selectValue);
				}
			});
		})

		$('body').on('click','.pagination a',function(event){
			var href=$(this).attr('href');
			var pages=$(this).html();
			client.setHash('poolPage',pages);
			var limit=$('.auction-search-pages').val();
			href=href+'&AuctionPoolProvider_limit='+limit
			$(this).attr({'href':href});
			return true;
		})
	})
</script>